package structure_pattern.observer_pattern;

import java.util.ArrayList;

/**
 * @author Feili
 * @since 2022/6/9 17:44
 */
abstract class NoticeControlCenter {

    protected Stock stock;

    protected ArrayList<User> userArrayList = new ArrayList<>();

    public Stock getStock() {
        return stock;
    }

    public void setStock(Stock stock) {
        this.stock = stock;
    }

    public void add(User user) {
        userArrayList.add(user);
    }

    public void remove(User user) {
        userArrayList.remove(user);
    }

    public abstract void notifyUser();
}